package com.lamer.console.common.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.NoArgsConstructor;

import java.util.Map;

@NoArgsConstructor
public class JSONUtil<T> {

    private static final ObjectMapper objectMapper = new ObjectMapper();

    public static ObjectMapper getInstance(){
        return objectMapper;
    }

    public static <T> T stringToObj(String jsonStr, Class<T> aClass) throws JsonProcessingException {
        return objectMapper.readValue(jsonStr, aClass);
    }




}
